package com.gao.controller;

import com.gao.dao.FilmMapper;
import com.gao.domain.Film;
import com.github.pagehelper.PageHelper;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author gao
 * @time 2020/07/23 22:32:43
 */
@RestController
@RequestMapping("films")
public class FilmController {

    @Autowired
    private FilmMapper filmMapper;

    @RequestMapping("find")
    @ResponseBody
    public List<Film> find() {
        PageHelper.startPage(2, 3);
        List<Film> films = filmMapper.findAll(null);
        return films;
    }
}
